SlideShare a Scribd company logo
1 of 20
Class No.13  Data Structures http://ecomputernotes.com
Trace of insert 17, 9, 14, 5 14 15 4 9 7 18 3 5 16 20 17 p p->setRight( node ); node http://ecomputernotes.com
Cost of Search ,[object Object],[object Object],[object Object],[object Object],http://ecomputernotes.com
Cost of Search ,[object Object],[object Object],[object Object],http://ecomputernotes.com
Cost of Search ,[object Object],[object Object],[object Object],http://ecomputernotes.com
Cost of Search ,[object Object],[object Object],[object Object],http://ecomputernotes.com
Binary Search Tree ,[object Object],[object Object],[object Object],http://ecomputernotes.com
Traversing a Binary Tree ,[object Object],[object Object],[object Object],http://ecomputernotes.com
Traversing a Binary Tree ,[object Object],14 15 4 (4, 14, 15), (4,15,14) (14,4,15), (14,15,4) (15,4,14), (15,14,4) http://ecomputernotes.com
Traversing a Binary Tree ,[object Object],node (L,N,R), (L,R,N) (N,L,R), (N,R,L) (R,L,N), (R,N,L) left subtree right subtree L N R http://ecomputernotes.com
Traversing a Binary Tree ,[object Object],node Preorder: (N,L,R) Inorder: (L,N,R) Postorder: (L,R,N) left subtree right subtree L N R http://ecomputernotes.com
Traversing a Binary Tree void preorder(TreeNode<int>* treeNode) { if( treeNode != NULL )  { cout << *(treeNode->getInfo())<<&quot; &quot;; preorder(treeNode->getLeft()); preorder(treeNode->getRight()); } } http://ecomputernotes.com
Traversing a Binary Tree void inorder(TreeNode<int>* treeNode) { if( treeNode != NULL )  { inorder(treeNode->getLeft()); cout << *(treeNode->getInfo())<<&quot; &quot;; inorder(treeNode->getRight()); } } http://ecomputernotes.com
Traversing a Binary Tree void postorder(TreeNode<int>* treeNode) { if( treeNode != NULL )  { postorder(treeNode->getLeft()); postorder(treeNode->getRight()); cout << *(treeNode->getInfo())<<&quot; &quot;; } } http://ecomputernotes.com
Traversing a Binary Tree cout << &quot;inorder: &quot;; preorder( root); cout << &quot;inorder: &quot;; inorder( root ); cout << &quot;postorder: &quot;; postorder( root ); http://ecomputernotes.com
Traversing a Binary Tree Preorder: 14 4 3 9 7 5 15 18 16 17 20 14 15 4 9 7 18 3 5 16 20 17 http://ecomputernotes.com
Traversing a Binary Tree Inorder: 3 4 5 7 9 14 15 16 17 18 20 14 15 4 9 7 18 3 5 16 20 17 http://ecomputernotes.com
Traversing a Binary Tree Postorder: 3 5 7 9 4 17 16 20 18 15 14 14 15 4 9 7 18 3 5 16 20 17 http://ecomputernotes.com
Recursive Call ,[object Object],[object Object],[object Object],[object Object],http://ecomputernotes.com
Stack Layout during a call ,[object Object],Parameters(F) Local variables(F) Return address(F) Parameters(F) Parameters(F) Local variables(F) Return address(F) Parameters(F) Local variables(F) Return address(F) Parameters(F) Local variables(F) Return address(F) During execution of F After call At point of call sp sp sp http://ecomputernotes.com

More Related Content

What's hot

Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search TreeAbhishek L.R
 
Binary search tree
Binary search treeBinary search tree
Binary search treeRacksaviR
 
Cinterviews Binarysearch Tree
Cinterviews Binarysearch TreeCinterviews Binarysearch Tree
Cinterviews Binarysearch Treecinterviews
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data StructureDharita Chokshi
 
Nach os assignment_2_teorica
Nach os assignment_2_teoricaNach os assignment_2_teorica
Nach os assignment_2_teoricacarmensp
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsAvjinder (Avi) Kaler
 
Manipulating Data using DPLYR in R Studio
Manipulating Data using DPLYR in R StudioManipulating Data using DPLYR in R Studio
Manipulating Data using DPLYR in R StudioRupak Roy
 
Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...
Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...
Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...Simon Price
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyrRomain Francois
 
Introduction to data.table in R
Introduction to data.table in RIntroduction to data.table in R
Introduction to data.table in RPaul Richards
 
Lecture 7 bst
Lecture 7 bstLecture 7 bst
Lecture 7 bstAbirami A
 
CSS: The Boring Bits
CSS: The Boring BitsCSS: The Boring Bits
CSS: The Boring BitsPeter Gasston
 

What's hot (20)

Binary Search Tree
Binary Search TreeBinary Search Tree
Binary Search Tree
 
B trees
B treesB trees
B trees
 
Binary search tree
Binary search treeBinary search tree
Binary search tree
 
Cinterviews Binarysearch Tree
Cinterviews Binarysearch TreeCinterviews Binarysearch Tree
Cinterviews Binarysearch Tree
 
Binary tree
Binary treeBinary tree
Binary tree
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
Binary Search Tree in Data Structure
Binary Search Tree in Data StructureBinary Search Tree in Data Structure
Binary Search Tree in Data Structure
 
Nach os assignment_2_teorica
Nach os assignment_2_teoricaNach os assignment_2_teorica
Nach os assignment_2_teorica
 
SAS and R Code for Basic Statistics
SAS and R Code for Basic StatisticsSAS and R Code for Basic Statistics
SAS and R Code for Basic Statistics
 
R seminar dplyr package
R seminar dplyr packageR seminar dplyr package
R seminar dplyr package
 
Manipulating Data using DPLYR in R Studio
Manipulating Data using DPLYR in R StudioManipulating Data using DPLYR in R Studio
Manipulating Data using DPLYR in R Studio
 
Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...
Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...
Querying and Merging Heterogeneous Data by Approximate Joins on Higher-Order ...
 
Jamal ppt b+tree dbms
Jamal ppt b+tree dbmsJamal ppt b+tree dbms
Jamal ppt b+tree dbms
 
Trees
TreesTrees
Trees
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
Introduction to data.table in R
Introduction to data.table in RIntroduction to data.table in R
Introduction to data.table in R
 
Lecture 7 bst
Lecture 7 bstLecture 7 bst
Lecture 7 bst
 
CSS: The Boring Bits
CSS: The Boring BitsCSS: The Boring Bits
CSS: The Boring Bits
 
Trees
TreesTrees
Trees
 
R brownbag seminar 2.3
R brownbag seminar 2.3R brownbag seminar 2.3
R brownbag seminar 2.3
 

Viewers also liked

computer notes - Data Structures - 25
computer notes - Data Structures - 25computer notes - Data Structures - 25
computer notes - Data Structures - 25ecomputernotes
 
computer notes - Data Structures - 4
computer notes - Data Structures - 4computer notes - Data Structures - 4
computer notes - Data Structures - 4ecomputernotes
 
computer notes - Data Structures - 14
computer notes - Data Structures - 14computer notes - Data Structures - 14
computer notes - Data Structures - 14ecomputernotes
 
computer notes - Data Structures - 6
computer notes - Data Structures - 6computer notes - Data Structures - 6
computer notes - Data Structures - 6ecomputernotes
 
computer notes - Data Structures - 21
computer notes - Data Structures - 21computer notes - Data Structures - 21
computer notes - Data Structures - 21ecomputernotes
 
computer notes - Data Structures - 27
computer notes - Data Structures - 27computer notes - Data Structures - 27
computer notes - Data Structures - 27ecomputernotes
 
computer notes - Data Structures - 36
computer notes - Data Structures - 36computer notes - Data Structures - 36
computer notes - Data Structures - 36ecomputernotes
 
computer notes - Data Structures - 37
computer notes - Data Structures - 37computer notes - Data Structures - 37
computer notes - Data Structures - 37ecomputernotes
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1ecomputernotes
 
computer notes - Data Structures - 18
computer notes - Data Structures - 18computer notes - Data Structures - 18
computer notes - Data Structures - 18ecomputernotes
 
computer notes - Data Structures - 7
computer notes - Data Structures - 7computer notes - Data Structures - 7
computer notes - Data Structures - 7ecomputernotes
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17ecomputernotes
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5ecomputernotes
 
computer notes - Data Structures - 22
computer notes - Data Structures - 22computer notes - Data Structures - 22
computer notes - Data Structures - 22ecomputernotes
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35ecomputernotes
 
computer notes - Data Structures - 15
computer notes - Data Structures - 15computer notes - Data Structures - 15
computer notes - Data Structures - 15ecomputernotes
 
computer notes - Data Structures - 39
computer notes - Data Structures - 39computer notes - Data Structures - 39
computer notes - Data Structures - 39ecomputernotes
 
computer notes - Data Structures - 34
computer notes - Data Structures - 34computer notes - Data Structures - 34
computer notes - Data Structures - 34ecomputernotes
 
computer notes - Data Structures - 23
computer notes - Data Structures - 23computer notes - Data Structures - 23
computer notes - Data Structures - 23ecomputernotes
 
computer notes - Data Structures - 16
computer notes - Data Structures - 16computer notes - Data Structures - 16
computer notes - Data Structures - 16ecomputernotes
 

Viewers also liked (20)

computer notes - Data Structures - 25
computer notes - Data Structures - 25computer notes - Data Structures - 25
computer notes - Data Structures - 25
 
computer notes - Data Structures - 4
computer notes - Data Structures - 4computer notes - Data Structures - 4
computer notes - Data Structures - 4
 
computer notes - Data Structures - 14
computer notes - Data Structures - 14computer notes - Data Structures - 14
computer notes - Data Structures - 14
 
computer notes - Data Structures - 6
computer notes - Data Structures - 6computer notes - Data Structures - 6
computer notes - Data Structures - 6
 
computer notes - Data Structures - 21
computer notes - Data Structures - 21computer notes - Data Structures - 21
computer notes - Data Structures - 21
 
computer notes - Data Structures - 27
computer notes - Data Structures - 27computer notes - Data Structures - 27
computer notes - Data Structures - 27
 
computer notes - Data Structures - 36
computer notes - Data Structures - 36computer notes - Data Structures - 36
computer notes - Data Structures - 36
 
computer notes - Data Structures - 37
computer notes - Data Structures - 37computer notes - Data Structures - 37
computer notes - Data Structures - 37
 
computer notes - Data Structures - 1
computer notes - Data Structures - 1computer notes - Data Structures - 1
computer notes - Data Structures - 1
 
computer notes - Data Structures - 18
computer notes - Data Structures - 18computer notes - Data Structures - 18
computer notes - Data Structures - 18
 
computer notes - Data Structures - 7
computer notes - Data Structures - 7computer notes - Data Structures - 7
computer notes - Data Structures - 7
 
computer notes - Data Structures - 17
computer notes - Data Structures - 17computer notes - Data Structures - 17
computer notes - Data Structures - 17
 
computer notes - Data Structures - 5
computer notes - Data Structures - 5computer notes - Data Structures - 5
computer notes - Data Structures - 5
 
computer notes - Data Structures - 22
computer notes - Data Structures - 22computer notes - Data Structures - 22
computer notes - Data Structures - 22
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
computer notes - Data Structures - 15
computer notes - Data Structures - 15computer notes - Data Structures - 15
computer notes - Data Structures - 15
 
computer notes - Data Structures - 39
computer notes - Data Structures - 39computer notes - Data Structures - 39
computer notes - Data Structures - 39
 
computer notes - Data Structures - 34
computer notes - Data Structures - 34computer notes - Data Structures - 34
computer notes - Data Structures - 34
 
computer notes - Data Structures - 23
computer notes - Data Structures - 23computer notes - Data Structures - 23
computer notes - Data Structures - 23
 
computer notes - Data Structures - 16
computer notes - Data Structures - 16computer notes - Data Structures - 16
computer notes - Data Structures - 16
 

Similar to computer notes - Data Structures - 13

Computer notes - Binary Search Tree with Strings
Computer notes - Binary Search Tree with Strings Computer notes - Binary Search Tree with Strings
Computer notes - Binary Search Tree with Strings ecomputernotes
 
Phylogenetics in R
Phylogenetics in RPhylogenetics in R
Phylogenetics in Rschamber
 
Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015Edhole.com
 
Please i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdfPlease i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdfezzi552
 
e computer notes - Binary search tree
e computer notes - Binary search treee computer notes - Binary search tree
e computer notes - Binary search treeecomputernotes
 
C++ BinaryTree Help Creating main function for Trees...Here are .pdf
C++ BinaryTree Help  Creating main function for Trees...Here are .pdfC++ BinaryTree Help  Creating main function for Trees...Here are .pdf
C++ BinaryTree Help Creating main function for Trees...Here are .pdfforecastfashions
 
Add these three functions to the class binaryTreeType (provided).W.pdf
Add these three functions to the class binaryTreeType (provided).W.pdfAdd these three functions to the class binaryTreeType (provided).W.pdf
Add these three functions to the class binaryTreeType (provided).W.pdfindiaartz
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashingecomputernotes
 
Mca admission in india
Mca admission in indiaMca admission in india
Mca admission in indiaEdhole.com
 
computer notes - Data Structures - 11
computer notes - Data Structures - 11computer notes - Data Structures - 11
computer notes - Data Structures - 11ecomputernotes
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongMario Fusco
 
Running Head Discussion Board .docx
Running Head Discussion Board                                  .docxRunning Head Discussion Board                                  .docx
Running Head Discussion Board .docxjeanettehully
 
Required to augment the authors Binary Search Tree (BST) code to .docx
Required to augment the authors Binary Search Tree (BST) code to .docxRequired to augment the authors Binary Search Tree (BST) code to .docx
Required to augment the authors Binary Search Tree (BST) code to .docxdebishakespeare
 
Computer notes - The const Keyword
Computer notes - The const KeywordComputer notes - The const Keyword
Computer notes - The const Keywordecomputernotes
 

Similar to computer notes - Data Structures - 13 (20)

Computer notes - Binary Search Tree with Strings
Computer notes - Binary Search Tree with Strings Computer notes - Binary Search Tree with Strings
Computer notes - Binary Search Tree with Strings
 
Unit8 C
Unit8 CUnit8 C
Unit8 C
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
Data Structure
Data StructureData Structure
Data Structure
 
Phylogenetics in R
Phylogenetics in RPhylogenetics in R
Phylogenetics in R
 
Admissions in india 2015
Admissions in india 2015Admissions in india 2015
Admissions in india 2015
 
Binary Trees
Binary TreesBinary Trees
Binary Trees
 
Please i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdfPlease i need help on following program using C++ Language.Add the.pdf
Please i need help on following program using C++ Language.Add the.pdf
 
e computer notes - Binary search tree
e computer notes - Binary search treee computer notes - Binary search tree
e computer notes - Binary search tree
 
C++ BinaryTree Help Creating main function for Trees...Here are .pdf
C++ BinaryTree Help  Creating main function for Trees...Here are .pdfC++ BinaryTree Help  Creating main function for Trees...Here are .pdf
C++ BinaryTree Help Creating main function for Trees...Here are .pdf
 
Add these three functions to the class binaryTreeType (provided).W.pdf
Add these three functions to the class binaryTreeType (provided).W.pdfAdd these three functions to the class binaryTreeType (provided).W.pdf
Add these three functions to the class binaryTreeType (provided).W.pdf
 
Antlr V3
Antlr V3Antlr V3
Antlr V3
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashing
 
Mca admission in india
Mca admission in indiaMca admission in india
Mca admission in india
 
computer notes - Data Structures - 11
computer notes - Data Structures - 11computer notes - Data Structures - 11
computer notes - Data Structures - 11
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Running Head Discussion Board .docx
Running Head Discussion Board                                  .docxRunning Head Discussion Board                                  .docx
Running Head Discussion Board .docx
 
Required to augment the authors Binary Search Tree (BST) code to .docx
Required to augment the authors Binary Search Tree (BST) code to .docxRequired to augment the authors Binary Search Tree (BST) code to .docx
Required to augment the authors Binary Search Tree (BST) code to .docx
 
Computer notes - The const Keyword
Computer notes - The const KeywordComputer notes - The const Keyword
Computer notes - The const Keyword
 
Trees
TreesTrees
Trees
 

More from ecomputernotes

computer notes - Data Structures - 30
computer notes - Data Structures - 30computer notes - Data Structures - 30
computer notes - Data Structures - 30ecomputernotes
 
computer notes - Data Structures - 20
computer notes - Data Structures - 20computer notes - Data Structures - 20
computer notes - Data Structures - 20ecomputernotes
 
Computer notes - Including Constraints
Computer notes - Including ConstraintsComputer notes - Including Constraints
Computer notes - Including Constraintsecomputernotes
 
Computer notes - Date time Functions
Computer notes - Date time FunctionsComputer notes - Date time Functions
Computer notes - Date time Functionsecomputernotes
 
Computer notes - Subqueries
Computer notes - SubqueriesComputer notes - Subqueries
Computer notes - Subqueriesecomputernotes
 
Computer notes - Other Database Objects
Computer notes - Other Database ObjectsComputer notes - Other Database Objects
Computer notes - Other Database Objectsecomputernotes
 
computer notes - Data Structures - 28
computer notes - Data Structures - 28computer notes - Data Structures - 28
computer notes - Data Structures - 28ecomputernotes
 
computer notes - Data Structures - 19
computer notes - Data Structures - 19computer notes - Data Structures - 19
computer notes - Data Structures - 19ecomputernotes
 
computer notes - Data Structures - 31
computer notes - Data Structures - 31computer notes - Data Structures - 31
computer notes - Data Structures - 31ecomputernotes
 
Computer notes - Advanced Subqueries
Computer notes -   Advanced SubqueriesComputer notes -   Advanced Subqueries
Computer notes - Advanced Subqueriesecomputernotes
 
Computer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group FunctionsComputer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group Functionsecomputernotes
 
Computer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY ClauseComputer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY Clauseecomputernotes
 
Computer notes - Manipulating Data
Computer notes - Manipulating DataComputer notes - Manipulating Data
Computer notes - Manipulating Dataecomputernotes
 
Computer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT StatementsComputer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT Statementsecomputernotes
 
computer notes - Data Structures - 10
computer notes - Data Structures - 10computer notes - Data Structures - 10
computer notes - Data Structures - 10ecomputernotes
 
Computer notes - Controlling User Access
Computer notes - Controlling User AccessComputer notes - Controlling User Access
Computer notes - Controlling User Accessecomputernotes
 
Computer notes - Using SET Operator
Computer notes - Using SET OperatorComputer notes - Using SET Operator
Computer notes - Using SET Operatorecomputernotes
 
computer notes - Data Structures - 29
computer notes - Data Structures - 29computer notes - Data Structures - 29
computer notes - Data Structures - 29ecomputernotes
 
computer notes - Data Structures - 38
computer notes - Data Structures - 38computer notes - Data Structures - 38
computer notes - Data Structures - 38ecomputernotes
 

More from ecomputernotes (19)

computer notes - Data Structures - 30
computer notes - Data Structures - 30computer notes - Data Structures - 30
computer notes - Data Structures - 30
 
computer notes - Data Structures - 20
computer notes - Data Structures - 20computer notes - Data Structures - 20
computer notes - Data Structures - 20
 
Computer notes - Including Constraints
Computer notes - Including ConstraintsComputer notes - Including Constraints
Computer notes - Including Constraints
 
Computer notes - Date time Functions
Computer notes - Date time FunctionsComputer notes - Date time Functions
Computer notes - Date time Functions
 
Computer notes - Subqueries
Computer notes - SubqueriesComputer notes - Subqueries
Computer notes - Subqueries
 
Computer notes - Other Database Objects
Computer notes - Other Database ObjectsComputer notes - Other Database Objects
Computer notes - Other Database Objects
 
computer notes - Data Structures - 28
computer notes - Data Structures - 28computer notes - Data Structures - 28
computer notes - Data Structures - 28
 
computer notes - Data Structures - 19
computer notes - Data Structures - 19computer notes - Data Structures - 19
computer notes - Data Structures - 19
 
computer notes - Data Structures - 31
computer notes - Data Structures - 31computer notes - Data Structures - 31
computer notes - Data Structures - 31
 
Computer notes - Advanced Subqueries
Computer notes -   Advanced SubqueriesComputer notes -   Advanced Subqueries
Computer notes - Advanced Subqueries
 
Computer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group FunctionsComputer notes - Aggregating Data Using Group Functions
Computer notes - Aggregating Data Using Group Functions
 
Computer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY ClauseComputer notes - Enhancements to the GROUP BY Clause
Computer notes - Enhancements to the GROUP BY Clause
 
Computer notes - Manipulating Data
Computer notes - Manipulating DataComputer notes - Manipulating Data
Computer notes - Manipulating Data
 
Computer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT StatementsComputer notes - Writing Basic SQL SELECT Statements
Computer notes - Writing Basic SQL SELECT Statements
 
computer notes - Data Structures - 10
computer notes - Data Structures - 10computer notes - Data Structures - 10
computer notes - Data Structures - 10
 
Computer notes - Controlling User Access
Computer notes - Controlling User AccessComputer notes - Controlling User Access
Computer notes - Controlling User Access
 
Computer notes - Using SET Operator
Computer notes - Using SET OperatorComputer notes - Using SET Operator
Computer notes - Using SET Operator
 
computer notes - Data Structures - 29
computer notes - Data Structures - 29computer notes - Data Structures - 29
computer notes - Data Structures - 29
 
computer notes - Data Structures - 38
computer notes - Data Structures - 38computer notes - Data Structures - 38
computer notes - Data Structures - 38
 

Recently uploaded

Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdfMuhammad Subhan
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxMasterG
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...ScyllaDB
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfOverkill Security
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityVictorSzoltysek
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistandanishmna97
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...FIDO Alliance
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهMohamed Sweelam
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingScyllaDB
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 

Recently uploaded (20)

Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
How to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in PakistanHow to Check GPS Location with a Live Tracker in Pakistan
How to Check GPS Location with a Live Tracker in Pakistan
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 

computer notes - Data Structures - 13

  • 1. Class No.13 Data Structures http://ecomputernotes.com
  • 2. Trace of insert 17, 9, 14, 5 14 15 4 9 7 18 3 5 16 20 17 p p->setRight( node ); node http://ecomputernotes.com
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Traversing a Binary Tree void preorder(TreeNode<int>* treeNode) { if( treeNode != NULL ) { cout << *(treeNode->getInfo())<<&quot; &quot;; preorder(treeNode->getLeft()); preorder(treeNode->getRight()); } } http://ecomputernotes.com
  • 13. Traversing a Binary Tree void inorder(TreeNode<int>* treeNode) { if( treeNode != NULL ) { inorder(treeNode->getLeft()); cout << *(treeNode->getInfo())<<&quot; &quot;; inorder(treeNode->getRight()); } } http://ecomputernotes.com
  • 14. Traversing a Binary Tree void postorder(TreeNode<int>* treeNode) { if( treeNode != NULL ) { postorder(treeNode->getLeft()); postorder(treeNode->getRight()); cout << *(treeNode->getInfo())<<&quot; &quot;; } } http://ecomputernotes.com
  • 15. Traversing a Binary Tree cout << &quot;inorder: &quot;; preorder( root); cout << &quot;inorder: &quot;; inorder( root ); cout << &quot;postorder: &quot;; postorder( root ); http://ecomputernotes.com
  • 16. Traversing a Binary Tree Preorder: 14 4 3 9 7 5 15 18 16 17 20 14 15 4 9 7 18 3 5 16 20 17 http://ecomputernotes.com
  • 17. Traversing a Binary Tree Inorder: 3 4 5 7 9 14 15 16 17 18 20 14 15 4 9 7 18 3 5 16 20 17 http://ecomputernotes.com
  • 18. Traversing a Binary Tree Postorder: 3 5 7 9 4 17 16 20 18 15 14 14 15 4 9 7 18 3 5 16 20 17 http://ecomputernotes.com
  • 19.
  • 20.

Editor's Notes

  1. End of lecture 12
  2. End of lecture 13.